﻿@{
    ViewBag.Title = "Custome";
}

@section scripts
{   
    <script src="@Url.Content("~/Scripts/shared/share.js")" type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/shared/shown.js")" type="text/javascript"></script>   
}
<form id="form1" runat="server" method="post" style = "width:100%;height:100%">
    <div id="layout1" class="mini-layout" style="width:100%;height:100%;"  borderStyle="border:0;">
        <div title="north" region="north" height="40"showHeader = "false" >
            <div class="mini-toolbar" style="padding:2px;border-top:0;border-left:0;border-right:0;">              
                <table style="width:100%;">
                    <tr>
                        <td style="width:100%;">
                            <a class="mini-button" name="save" iconCls="icon-ok" onclick="saveData" plain="true"  ennable="true">一键清理</a>
                            <span class="separator"></span>
                            <a class="mini-button" iconCls="icon-close" onclick="CloseWindow" plain="true">关闭</a>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div region="center" showHeader = "false" >
            <div id="tabs1" class="mini-tabs" activeIndex="0" style="width:100%;height:100%;" plain="false"  borderStyle="border:0;">
                <div name="tabIOS" title="业务数据" >
                  <table width = "300px" height ="100%" style="margin-left:20px;">
                    <tr>
                        <td width="100px" height ="50px" align="right">数据清理密码：</td>
                        <td width="200px" height ="50px">
                            <input name="FPassword" id="FPassword" class="mini-password" style="width:190px;" value=""/>
                        </td>
                        <td width="100px" height ="50px" align="right"><font color="#FF0000" size ="5">提示：</font></td>
                        <td width="200px" height ="50px"><font color="#FF0000" size ="5" >数据清理后，将无法找回，请慎重操作。</font></td>
                    </tr>
                    <tr>
                        <td width="100px" align="right" valign="top">数据清理项：</td>
                        <td width = "250px" height ="100%" valign="top">
                            <div id="mStockData" class="mini-checkbox" name="mStockData" readonly="false" text="库存数据"></div><br/>  
                            <div id="mInsdata" class="mini-checkbox" name="mInsdata" readonly="false" text="采购数据"></div><br />  
                            <div id="mOutData" class="mini-checkbox" name="mOutData" readonly="false" text="销售数据"></div><br /> 
                            <div id="mInvdata" class="mini-checkbox" name="mInvdata" readonly="false" text="库存调整单据"></div><br /> 
                            <div id="mPrsData" class="mini-checkbox" name="mPrsData" readonly="false" text="促销数据"></div> <br />
                            <div id="mRmoData" class="mini-checkbox" name="mRmoData" readonly="false" text="配送数据"></div> <br />
                            </td>
                        </tr>
                        <td width="100px" align="right"></td>
                        <td width="200px" ></td>
                    </table>
                </div>
                <div name="baseIOS" title="基本资料" >
                  <table width = "300px" height ="100%" style="margin-left:20px;">
                    <tr>
                        <td width="100px" height ="50px" align="right">数据清理密码：</td>
                        <td width="200px" height ="50px">
                            <input name="FPassword1" id="FPassword1" class="mini-password" style="width:190px;" value=""/>
                        </td>
                        <td width="100px" height ="50px" align="right"><font color="#FF0000" size ="5">提示：</font></td>
                        <td width="200px" height ="50px"><font color="#FF0000" size ="5" >数据清理后，将无法找回，请慎重操作。</font></td>
                    </tr>
                    <tr>
                        <td width="100px" align="right" valign="top">数据清理项：</td>
                        <td width = "250px" height ="100%" valign="top">
                            <div id="mGoodClass" class="mini-checkbox" name="mGoodClass" readonly="false" text="商品分类"></div><br/>  
                            <div id="mGoodData" class="mini-checkbox" name="mGoodData" readonly="false" text="商品资料"></div><br/>  
                            <div id="mMemberData" class="mini-checkbox" name="mMemberData" readonly="false" text="会员资料"></div><br />  
                            <div id="mBaseData" class="mini-checkbox" name="mBaseData" readonly="false" text="其它资料"></div><br />
                        </td>
                        </tr>
                        <td width="100px" align="right"></td>
                        <td width="200px" ></td>
                    </table>
                </div>
            </div>
        </div>
    </div>

<script>
    mini.parse();

    function FormShown() {
    }

    function saveData() {
        mini.confirm("数据清理后将无法找回，确定要清理吗？", "提示",
            function (action) {
                if (action == "ok") {
                    var form = new mini.Form("#form1");
                    var data = form.getData(true, false);
                    var datajson = mini.encode(data);
                    var param = parent.window.getSystemAppID();
                    $.post("SetDataClear", { mjson: datajson, mSystemAppID: param }, function (data) {
                        var ret = mini.decode(data);
                        if (ret.status == "1")
                            mini.showTips({ content: ret.msg, state: "success", x: "center", y: "top", timeout: 3000 });
                        else
                            mini.showTips({ content: ret.error, state: "danger", x: "center", y: "top", timeout: 3000 });
                    });
                }
            }
       );
    }  
</script>
</form>